

#import "PageOneViewController.h"
#import "SearchViewController.h"
#import "Constants.h"

@implementation PageOneViewController
@synthesize button1, button2;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
	if (!(self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
        return nil;

    self.title = NSLocalizedString(@"PageOneTitle", @"");

	return self;
}

- (void)viewDidLoad
{
	// Add our custom add button as the nav bar's custom right view
	UIBarButtonItem *addButtonright = [[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Home", @"")
																   style:UIBarButtonItemStyleBordered
																  target:self
																  action:@selector(addAction:)] autorelease];
	self.navigationItem.rightBarButtonItem = addButtonright;
	
}


- (IBAction)addAction:(id)sender
{
	[self.navigationController popViewControllerAnimated:YES];
}


- (IBAction)ButtonPressedSearch:(id)sender{
	UIViewController *targetViewController;
		targetViewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil];
		[self.navigationController pushViewController:targetViewController animated:YES];
		[targetViewController release];
}

- (IBAction)ButtonPressedCreate:(id)sender{
	[self.navigationController popViewControllerAnimated:YES];
}

- (void)dealloc
{
	[button1 release];
	[button2 release];
	[super dealloc];
}


@end
